package com.cswangdao.controller.admin;

import com.cswangdao.domain.vo.RegionVo;
import com.cswangdao.result.Result;
import com.cswangdao.service.RegionService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RequestMapping("/admin/region")
@RestController
@Slf4j
public class AdminRegionController {

    @Autowired
    private RegionService regionService;

    /**
     * @description: 查询省市区信息
     * @param: request, response
     * @return: void
     */
    @GetMapping("/list")
    public Result<RegionVo> list() {
        log.info("查询省市区信息");
        RegionVo regionVo = regionService.list();
        return Result.success(regionVo);
    }
}
